#include <string>
#include <iostream>

#include "World.h"
#include "debug.h"

int main(int argc, char** argv)
{
	std::string map_name;
	
	if (argc > 1)
		map_name = argv[1];
	else
		map_name = "entrance";
	

	try
	{
		//debug.setFlag(Debug::BB_INFO);
		//debug.setFlag(Debug::MEM_INFO);
		//debug.setFlag(Debug::PLAN_INFO);
		//debug.setFlagStream(Debug::BB_INFO, &std::cout);

		World* w = World::getWorld();
		w->Init("video.conf");

		World::getMap()->loadToNewHub(map_name.c_str());

		bool notdone = false;
		do
		{
			notdone = w->update();
		} while (notdone);

		delete w;
	}
	catch(Exception e)
	{
		std::cout << "Something bad happened: " << e << std::endl;
	}

	return 0;
}

